<?php
session_start();
?>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>
<?php
	include ('include/conn.php');
	include ('include/config.php');
	 $action = $_GET['action'];

	if($action == 'logout')
	{
		$_SESSION['username'] ='';
	}

	$username=$_SESSION['username'];
	
	if(trim($username) <> '')
	{ 
			echo <<<aaa
				<script language="javascript">
				location.href='admin_index.php';
				</script>
aaa;
	}
	

?>
<body>
<LINK rev="stylesheet" media="screen" href="cssadmin.css" type="text/css" 
rel="stylesheet">
<script language="javascript">

	function yz()
	{
		var user_check=document.getElementById('username').value
		var password_check=document.getElementById('password').value
		if(user_check=="")
		{
			alert('用户不能为空')
			return false
		}
		if(password_check=="")
		{
			alert('密码不能为空')
			return false
		}
	}
</script>
	<div class="page">
		<form method="POST" action="admin_check.php" onsubmit='return yz()'>
			<div>
			账户：
			</div>
			<div class="textarea">
				<input type="text" name="username" id="user">
			</div>
			<br>
			<div>
			密码：
			</div>
			<div>
				<input type="password" name="password" id="password">
			</div>
			
			<div>
				<input class="btn" type="submit" value="提交">
			</div>
		</form>
</body>